package com.itheima.jobs;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.itheima.dao.RegularCleaningDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ClearOrderJob {

    @Autowired
    RegularCleaningDao regularCleaningDao;
    public void clearOrderJob(){
        String date = DateUtil.format(new Date(), "yyyy-MM-dd");
        regularCleaningDao.deleteOrder(date);
        regularCleaningDao.deleteOrderSet(date);

        System.out.println(new Date());
    }


}
